package com.example.higo.api.service;

import rx.Subscriber;

/**
 * Created by wj on 2016/11/6.
 */

public abstract class BaseSubscriber<T> extends Subscriber<T>{
    public abstract void onSuccess(T t);
    public abstract void onFinish();
    public abstract void onFail(ExceptionHandle.ResponeThrowable e);

    @Override
    public void onCompleted() {
        onFinish();
    }

    @Override
    public void onError(Throwable e) {
        onFail(ExceptionHandle.handleException(e));
    }

    @Override
    public void onNext(T t) {
        onSuccess(t);
    }
}
